package com.oop.exception;

public class Demo01 {
    public static void main(String[] args) {
        int a =1;
        int b = 0;
        //ctrl+alt+t   快捷键
        try {
            System.out.println(a/b);
        } catch (ArithmeticException e) {
            e.getMessage();  //打印错误的栈信息
        } finally {
            System.out.println("kk");
        }

    }

}
/*
try {   //try监控区域
            System.out.println(a/b);
        }catch (ArithmeticException e){   //捕获异常
            System.out.println("程序出现异常，变量b不能为0");
        }finally {  //处理善后工作
            System.out.println("finally");
        }

 */